import {useLocation} from 'react-router-dom'
export default function Info(){
    console.log(useLocation())
    // 获取state传递的参数
    let {goodsname,price} = useLocation().state
    return (
        <div>
            <h1>详情页---{goodsname}---{price}</h1>
        </div>
    )
}